<template>
		<NavBar icon="left" title="仓库地址" />
	<view class="contain bg-[#f2f2f2] p-2">
		 <view class=" item bg-white mb-2 p-2 pt-4 pb-4"  v-for=" i in list">
		 <view class="flex w-full flex-row-reverse justify-between ">
				<uv-button type="primary" size="mini" class="  float-right" @click="copy(i)" text="复制"></uv-button>
		 	<text class="float-left text-[#6699ff]">{{i.name}}</text>
		 </view>
			<view class="text-[12px]" >
				<view class="flex w-full pt-2">
					<view class="w-[30%]   ">
						联系人:
					</view>
					<view class="w-[70%]   ">
						{{i.contactName}}-(会员ID：{{user.userInfo.userId}})
					</view>
				</view>
				<view class="flex w-full  pt-2">
					<view class="w-[30%]   ">
						联系电话:
					</view>
					<view class="w-[70%]     ">
						{{i.contactPhone}}
					</view>
				</view>
				<view class="flex w-full  pt-2 ">
					<view class="w-[30%]   ">
						收货地址:
					</view>
					<view class="w-[70%]     ">
						{{i.address}}-(会员ID：{{user.userInfo.userId}})
					</view>
				</view>
				
			</view>
		
		 </view>  
		 
	</view>
</template>

<script setup>
	import * as api  from '@/api/modules/warehouse_address.js'
	import store from '@/store/index.js'
	const user = store().user
	const list = ref([])
    const getWarehouseAddress =async () =>{
		const {rows } = await api.warehouseAddressAPI()
        list.value =  rows
	}
	getWarehouseAddress()
	const copy = (i)=>{
		uni.setClipboardData({
			data: `${i.contactName}-(会员ID:${user.userInfo.userId}) ${i.contactPhone} ${i.address}-(会员ID:${user.userInfo.userId})`,
			success: function () {
			uni.showToast({
				title:'复制成功',
				icon:'none'
			})
			}
		});
	}
</script>

<style>
.contain {
		height: calc(100vh - 44px  ); 
		overflow-y: auto;
	}
 
</style>
